//
//  XWHCalendarHelper.swift
//  XiaoweHealthy
//
//  Created by Riven on 2022/4/27.
//

import Foundation
import UIKit
import JTAppleCalendar


class JTCalendarHelper {
    
    static var curColor: UIColor {
        btnBgColor
    }
    
    static var normalColor: UIColor {
        majorTextColor
    }
    
    static var disableColor: UIColor {
        majorTextColor.withAlphaComponent(0.22)
    }
    
    static var startDate: Date {
//        let cDate = Date().adding(.year, value: -3).yearBegin
//        let cDate = Date().yearBegin
        let cDate = Date().dayBegin
        return cDate
    }
    
    static var firstDayOfWeek: DaysOfWeek {
        .monday
    }
    
    static var calendarContentInset: CGFloat {
        18
    }
    
    static var calendarInset: CGFloat {
        16
    }
    
    static var calendarWidth: CGFloat {
        let cViewWidth: CGFloat = (UIScreen.main.bounds.width - calendarContentInset * 2 - calendarInset * 2)
        
        var minimumDifference = Int(cViewWidth) % 7 // 最小差值
        if (minimumDifference + Int(cViewWidth)) % 7 != 0 {
            minimumDifference = 7 - minimumDifference
        }
        let maxWidth = CGFloat(minimumDifference) + cViewWidth
        
        return maxWidth + calendarContentInset * 2
    }
    
    static var calendarHeight: CGFloat {
        469
    }
    
}
